<?

if ($c = stack('name')) {

	$_id_component	= $DATA['components'][$c]['id'];			//	list id value
	$_id_data		= D_MB_DATA;			//	meta id value
	$_id_meta		= D_MB_META;			//	meta id value

	// get current date
	$DATA['today'] = parse_today();
	
	if (!($dt = param('date')) || !($dt = parse_date($dt)) ) 		// get date from param (y2k-YY-MM-DD) if correct, elsewere get current date
		$dt = $DATA['today'];
	
	$DATA['date'] = $dt;

	$_crit = "id_data=$_id_data AND id_parent=$_id_component AND DATE(date)='{$DATA[date][full]}' AND assoc='{$CONTEXT[lang]}'";


	$DATA['components'][$c]['data'] = datafetch('db_item', tb('data'), $_crit, 'value as text');
	
	unstack();
}

?>